<?php

class BaseActiveRecord extends CActiveRecord
{
    public function checkboxes()
    {
        return array();
    }
    
    public function setAttributesFromRequest($requestName)
    {
        $attributes       = Yii::app()->request->getParam($requestName);
        $this->attributes = $attributes;

        foreach ( $this->checkboxes() as $checkboxName )
        {
            $this->$checkboxName = isset($attributes[$checkboxName]) ? 1 : 0;            
        }
    }
}